#include<stdio.h>
int main()
{     
	int Div=0,Multi=0,a=0,b=0,rem=0,t=0,y=0;
	scanf("%d%d",&a,&b);
	t =a;
	y = b;
	do  {
		rem=a%b;
		a=b;
		b=rem;
		Div = a; }
	while(rem!=0) ;
	printf("%d\n",Div);
	Multi = t*y/Div;
	printf("%d\n",Multi);
	return 0;
}
       
 


